#ifndef __KeyEnvent_h__
#define __KeyEnvent_h__
#include "Framework.h"

/* mmi key code */
typedef enum
{
/*
 * The key code sequency cannot be changed.
 */
    KEY_0 = 0,
    KEY_1,
    KEY_2,
    KEY_3,
    KEY_4,
    KEY_5,
    KEY_6,
    KEY_7,
    KEY_8,
    KEY_9,
    KEY_LSK,
    KEY_RSK,
    KEY_OK,
    KEY_UP,
    KEY_DOWN,
    KEY_LEFT,
    KEY_RIGHT,
    KEY_CLEAR,
    KEY_STAR,
    KEY_POUND,
    KEY_VOL_UP,
    KEY_VOL_DOWN,
	KEY_BACK,
	
    MAX_KEYS,

    KEY_INVALID = 0xFE
} mmi_keypads_enum;

typedef enum
{
    KEY_EVENT_DOWN = 0,
    KEY_EVENT_UP,
    KEY_LONG_PRESS,
    KEY_REPEAT,
    MAX_KEY_TYPE
} mmi_key_types_enum;

/* mmi key event */
typedef struct
{
    VMINT16 mmi_key_code;     /* mmi key code, see GlobalConstants.h mmi_keypads_enum */
    VMINT16 mmi_key_type;     /* mmi key type, see GlobalConstants,h mmi_key_types_enum */
    VMINT16 cvt_code;
    VMINT16 cvt_type;
} mmi_key_evt_struct;

typedef struct
{
	FuncPtr currKeyFuncPtrs[MAX_KEYS][MAX_KEY_TYPE];
}mmi_key_func;

extern void KeyEventInit(void);
extern void KeyEventHandle(VMINT event, VMINT keycode);





extern void SetKeyHandle(FuncPtr funcPtr, VMINT16 keyCode, VMINT16 keyType);
extern void SetGroupKeyHandle(FuncPtr funcPtr, VMINT16 *keysCode, VMINT Len, VMINT16 keyType);
extern FuncPtr GetKeyHandle(VMINT16 keyCode, VMINT16 keyType);
extern void ClearKeyHandle(VMINT16 keyCode, VMINT16 keyType);
extern void ClearAllKeyHandler(void);

extern void TouchExecKeyHandle(VMINT16 mmi_key_code, VMINT16 mmi_key_type);

#endif
